<template>
  <div class="home">
    <el-container>
      <el-aside width="200px">
        <div class="title flex items-center flex-col  justify-between py-3">
          <img src="../../assets/logo.png" class="logo-15" alt="">
          <span>聚有趣后台管理系统</span>
        </div>

        <el-menu background-color="#4285f4" text-color="#fff" active-text-color="#fff" :router="true">
          <el-menu-item index="/user">
            <el-icon>
              <User />
            </el-icon>
            <span>会员管理</span>
          </el-menu-item>
        </el-menu>

      </el-aside>

      <el-container>
        <el-header>
          <el-popconfirm title="您确定要退出登录吗？" @confirm="exit">
            <template #reference>
              <div class="flex items-center">
                <span>退出登录</span>
                <el-icon>
                  <DArrowRight />
                </el-icon>
              </div>
            </template>
          </el-popconfirm>

        </el-header>

        <el-main>
          <router-view />
        </el-main>



      </el-container>
    </el-container>
  </div>
</template>

<script setup lang="ts">
import router from '../../router';
import useStore from '../../store/index'; 
import { computed,onMounted } from 'vue';
const store = useStore();
// const { proxy } = getCurrentInstance() as { proxy: any };
const user = computed(() => store.user.getUserInfo);

// let page=ref<number>(1)
// let size=ref<number>(10)

const exit = (): void => {
 
  store.user.removeUser()
  router.push('/login');

}

onMounted(()=>{
  console.log(user)
  // getInit()
})

// const getInit=():void=>{
//   proxy.api.user.list({page:page.value,size:size.value}).then((rsp:any)=>{
//     console.log(rsp)
//   })
// }


</script>
<style lang="less" scoped>
@import url("./home.less");
</style>